package org.finmanager.core;


import static org.junit.Assert.*;

import org.finmanager.core.Category;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class Category_testing {
	Category test;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		test = new Category("test", true);
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void getName_test() {
		assertEquals("message", "test", test.getName());
	}
	
	@Test
	public void isFavourite_test() {
		assertTrue("message", test.isFavourite());
	}
	
	@Test
	public void toggleFavourite_true_test() {
		test.toggleFavourite();
		assertFalse("message", test.isFavourite());
	}
	@Test
	public void toggleFavourite_false_test() {
		test.toggleFavourite();
		test.toggleFavourite();
		assertTrue("message", test.isFavourite());
	}
	
	@Test
	public void toString_test() {
		assertEquals("message", "test", test.toString());
	}
	
	@Test
	public void testIsFilterSelected() {
		assertTrue("message", test.isFilterSelected());
	}

	@Test
	public void testToggleFilterSelectio01() {
		test.toggleFilterSelection();
		assertFalse("message", test.isFilterSelected());
	}
	
	@Test
	public void testToggleFilterSelectio02() {
		test.toggleFilterSelection();
		test.toggleFilterSelection();
		assertTrue("message", test.isFilterSelected());
	}
	
	@Test
	public void testResetFilterSelection() {
		test.toggleFilterSelection();
		test.resetFilterSelection();
		assertTrue("message", test.isFilterSelected());
	}

}
